<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>init demo</title>
  <script src="../../dist/vue.js"></script>
</head>

<body>
  <div id="app">
    {{title}}
    <component-a post-title="hello!"></component-a>
    <div @click="getVue">
      点击
    </div>
  </div>
  <script>
    var ComponentA = {
      // props: ['postTitle'],
      data: () => {
        return {
          postTitle: "postTitle"
        }
      },
      template: `
      <div>
        <h3>{{ postTitle }}</h3>
      <div @click="getSubVue">子元素点击</div>
      </div>
      `,
      methods: {
        getSubVue() {
          console.log('my console  SubVue.options : ', Vue.options);
          console.log('my console  SubVue.prototype : ', Vue.prototype);
          console.log('my console  SubVue.data : ', this.$data);
        }
      }
    };
    var vue = new Vue({
      components: {
        'component-a': ComponentA,
      },
      data: () => {
        return {
          title: "1111"
        }
      },
      watch: {
        title: {
          handler: function (val) {
            console.log('my console val : ', val);
          },
          immediate: true
        }
      },
      methods: {
        getVue() {
          console.log('my console  Vue.prototype : ', Vue.prototype);
          console.log('my console  this.$options : ', this.$options);
          console.log('my console  this.data : ', this.$data);
        }
      }
    }).$mount("#app");
    console.log('my console vue : ', vue);
  </script>
</body>

</html>